package com.zl.controller;

import com.zl.model.Cat;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
public class CatBeans {
    @Scope("prototype")
//    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    @Bean
    public Cat cat(){
        Cat cat=new Cat();
        cat.setId(1);
        cat.setName("菊花");
        cat.setAge(2);
        return cat;
    }
}
